package org.aceor.tennis.common.enums;

/**
 * Created by lxue on 16/5/13.
 */
public enum PlayerLevel {
    LEVEL0("入门", 0),
    LEVEL2_5("2.5左右", 1),
    LEVEL3_5("3.5左右", 2),
    LEVEL5("5.0左右", 3),
    LEVEL5UP("5.0以上", 4);

    private String desc;
    private Integer value;

    PlayerLevel(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public Integer getValue() {
        return value;
    }

    public static PlayerLevel valueof(int value) {
        switch (value) {
            case 0:
                return LEVEL0;
            case 1:
                return LEVEL2_5;
            case 2:
                return LEVEL3_5;
            case 3:
                return LEVEL5;
            case 4:
                return LEVEL5UP;
            default:
                throw new IllegalArgumentException();
        }
    }
}
